module.exports = ({ list, pageNo = 1, pageSize = 10 }) => {
    let result = []

    pageNo = pageNo < 0 ? 1 : pageNo

    let total = list.length

    let pageTotal = Math.ceil(total / pageSize)
    for (let i = 0; i < pageTotal; i++) {
        let start = i * pageSize
        let end = i * pageSize + pageSize
        let pageNo = i + 1
        result.push({ list: list.slice(start, end), pageNo, total, pageTotal })
    }

    return result
}